Skip to main content

All Questions

2votes
1answer
60views

Merge Sort with Minimum Sufficient Variables, Verbosity and better Space Complexity

The majority of merge sort implementations searched online are provided with unnecessary variables and code lines. Here is an attempt to reduce that. However, does passing back the subArray as return ...
Thomas Mathew's user avatar
3votes
2answers
384views

Check whether array is sorted recursively

I'm trying to implement isSorted method checking whether given array is sorted recursively. I've written two types, one is similar to merge sort logic, the another ...
Soner from The Ottoman Empire's user avatar
2votes
0answers
373views

Follow-up 1: Compare 2 unordered, rooted trees for shape-isomorphism

The previous post can be found here. In the previous post I tried to solve an exercise but found through the answer of Peilonrayz a bug in the code and 2 more while fixing it. These have now been ...
Philipp Doerner's user avatar
2votes
2answers
1kviews

Compare 2 unordered, rooted trees for shape-isomorphism

I'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, german version) on my own and am trying to solve one of the exercises there. Edit: This question now also has a ...
Philipp Doerner's user avatar
5votes
3answers
2kviews

Merge Sort Implementation in Java (that seems slow...)

I decided to write my own implementation of merge sort. Here is the code: ...
TheCoffeeCup's user avatar
2votes
2answers
7kviews

Simplest quick sort using one 19-line function

This will later be be posted on my website to explain quick sort so I would like how I could improve the readability and simplicity of this demo class. I do not like my use of the stack (meaning this ...
Lee Allan's user avatar

close